<?php
include_once "db.php";
include_once "checksession.php"; 
include_once "auth_permissions.php"; 
authorize("user");

$problem = mysql_query("select * from problem_type WHERE problem_type.status = '0'");

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Add a Ticket</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="meta-style.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
</head>

<body>

<?php
include_once "topnav.php";
// auto fill out area of the form that were enterend in if phonecall came back an error
if (isset($_GET['f_name']) && $_GET['f_name'] != 'error') $first_name = $_GET['f_name'] ? $_GET['f_name'] : null;
if (isset($_GET['l_name']) && $_GET['l_name'] != 'error') $last_name = $_GET['l_name'] ? $_GET['l_name'] : null;
if (isset($_GET['KNum']) && $_GET['KNum'] != 'error') $KNum = $_GET['KNum'] ? $_GET['KNum'] : null;
if (isset($_GET['pipelineuserid']) && $_GET['pipelineuserid'] != 'error') $pipelineuserid = $_GET['pipelineuserid'] ? $_GET['pipelineuserid'] : null;
if (isset($_GET['birthdate']) && $_GET['birthdate'] != 'error') $birthdate = $_GET['birthdate'] ? $_GET['birthdate'] : null;
?>

<FORM action="insert_phone.php" METHOD="POST">
	<input type="hidden" name="HDuserID" value="<? echo $_SESSION['ID'] ?>">
	<input type="hidden" name="problem_type" value="21">
	<input type="hidden" name="Problem" value="The student forgot the answer to their secret question">
	<input type="hidden" name="notes" value="Added the student to the Pipeline secret question reset list in google docs.">
	<input type="hidden" name="high_level" value="0">
	<input type="hidden" name="call_closed" value="2">
    <input type="hidden" name="transfer_to" value="">
	<?
 if ($_GET['error']) {
  if($_GET['f_name'] == "error") {
   print "<p class='error'>Please enter your First Name.</p>";
  }
  if($_GET['l_name'] == "error") {
   print "<p class='error'>Please enter your Last Name.</p>";
  } 
  
 }
?>
   <table width="800" BORDER=1 cellpadding=5 cellspacing=0 bordercolor="#006699" background="#CCCCCC" align="center">
    <tr align="left" valign="top">
      <td colspan="2" bordercolor="#006699" bgcolor="#006699"><font color="white"><span class="style1">Add a new Secret Question ticket</span></td>
    </tr>
	<tr>
	<td colspan="2"><font color="red">* = Required</font></td>
	</tr>
    <tr valign="top">
      <td width="50%" align="right" class="normalblue"><b>First Name</b></td>
      <td width="50%" align="left"><input name="f_name" type="TEXT" id="f_name" value="<?php echo $first_name; ?>" size="35"></td>
    </tr>
    <tr valign="top">
      <td width="50%" align="right" class="normalblue"><b>Last Name</b></td>
      <td width="50%" align="left"><input name="l_name" type="TEXT" id="l_name" value="<?php echo $last_name; ?>" size="35"></td>
    </tr>
     <tr valign="top">
       <td align="right" class="normalblue"><b>Student ID (K#)</b></td>
       <td align="left"><input name="KNum" type="TEXT" id="KNum" value="<?php echo $KNum; ?>" size="35"></td>
     </tr>
     <tr valign="top">
       <td align="right" class="normalblue"><b>Pipeline ID</b></td>
       <td align="left"><input name="pipelineuserid" type="TEXT" id="pipelineuserid" value="<?php echo $pipelineuserid; ?>" size="35"></td>
     </tr>
     <tr valign="top">
     	<td align="right" class="normalblue"><b>Date of Birth</b></td>
        <td aligh="left"><input name="birthdate" type="text" id="birthdate" value="<?php echo $birthdate; ?>" size="35"></td>
     </tr>
     <tr valign="top">
		<td align="right" class="normalblue"><strong><b><font color="#FF0000">*</font></b>Contact Type?</strong> </td>
		<td align="left" class="normalblue">
	  
 
   			<input type="radio" name="contact_type" value="phone" >Phone
			<input type="radio" name="contact_type" value="email">Email
			<input type="radio" name="contact_type" value="in-person">In-Person
			<input type="radio" name="contact_type" value="voicemail">Voicemail
         </td>
     </tr>

     <tr valign="top">
       <td width="50%" align="right" class="normalblue">&nbsp;</td>
       <td width="50%" align="left"><span class="normalblue">
         <input type=SUBMIT value="Submit Call" name="SUBMIT">
       </span></td>
     </tr>
  </table>
</FORM>

   
</body>
</html>
